//
//  CheckWeb.m
//  忘不了
//
//  Created by rimi on 16/7/26.
//  Copyright © 2016年 handuan. All rights reserved.
//

#import "CheckWeb.h"
#import "AFNetworking.h"
@implementation CheckWeb
+ (BOOL)checkWang{
   __block BOOL isWeb ;
    AFNetworkReachabilityManager *manager1 = [AFNetworkReachabilityManager sharedManager];
    [manager1 setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        switch (status) {
            case AFNetworkReachabilityStatusNotReachable:
                isWeb = NO;
                break;
            case AFNetworkReachabilityStatusReachableViaWiFi:
                isWeb = YES;
                break;
            case AFNetworkReachabilityStatusReachableViaWWAN:
                isWeb = YES;
                break;
            case AFNetworkReachabilityStatusUnknown:
                isWeb = NO;
                break;
            default:
                break;
        }
    }];
    [manager1 startMonitoring];
    NSLog(@"%d",isWeb);
    return isWeb;
}

@end
